<template>
  <el-card shadow="never">
    <div slot="header" v-if="hasHeader">
      <div class="d-flex justify-space-between align-center">
        <span class="font-weight-bold">{{ title }}</span>
        <el-button
          v-if="hasAdd"
          type="primary"
          icon="el-icon-plus"
          @click="$emit('add')"
        >
          {{ btnText }}
        </el-button>
        <slot name="btns"></slot>
      </div>
    </div>
    <slot></slot>
  </el-card>
</template>

<script setup>
const props = defineProps({
  title: {
    typeof: "string",
    default: "",
  },
  hasAdd: {
    type: Boolean,
    default: true,
  },
  hasHeader: {
    type: Boolean,
    default: true,
  },
  btnText: {
    type: String,
    default: "新增",
    required: false,
  },
});
</script>

<style scoped>
/* 你的自定义样式 */
</style>
